<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<ui:composition template="/pages/layout/mainLayout.xhtml">
	<ui:define name="bodyComUsuario">

		<div class="post">
		<h2 class="title"><h:outputLabel
			value="#{bundle['locanet.cliente.busca.titulo']}" /></h2>
		<h:form>
			<h:panelGrid columns="2">
				<h:outputLabel value="#{bundle['locanet.pessoa.nome']}" />
				<h:inputText maxlength="100" value="#{clienteBean.entity.nome}" />

				<h:outputLabel value="#{bundle['locanet.cliente.cpf']}" />
				<h:inputText maxlength="11" value="#{clienteBean.entity.cpf}" />

				<h:outputLabel value="#{bundle['locanet.pessoa.login']}" />
				<h:inputText maxlength="20" value="#{clienteBean.entity.login}" />

				<h:outputLabel value="#{bundle['locanet.cliente.endereco']}" />
				<h:inputText maxlength="100" value="#{clienteBean.entity.endereco}" />

				<h:outputLabel value="#{bundle['locanet.cliente.cep']}" />
				<h:inputText maxlength="20" value="#{clienteBean.entity.cep}" />

				<h:commandButton value="#{bundle['locanet.butoes.buscar']}"
					action="#{clienteBean.search}" />
				<h:commandLink styleClass="button" immediate="true"
					action="CLIENTE_INSERT" value="#{bundle['locanet.butoes.inserir']}" />
			</h:panelGrid>
		</h:form></div>
		<div class="post"><h:form>
			<p:dataTable value="#{clienteBean.entities}" var="c" paginator="true" rows="10">

				<p:column>
					<h:commandLink action="#{clienteBean.openUpdate}" styleClass="button"
						value="#{bundle['locanet.entidades.lista.editar']}">
						<f:setPropertyActionListener value="#{c.id}"
							target="#{clienteBean.entity.id}" />
					</h:commandLink>
				</p:column>
				<p:column>
					<h:commandLink action="#{clienteBean.remove}" styleClass="button"
						value="#{bundle['locanet.entidades.lista.excluir']}">
						<f:setPropertyActionListener value="#{c.id}"
							target="#{clienteBean.entity.id}" />
					</h:commandLink>
				</p:column>

				<p:column>
					<f:facet name="header">
						<h:outputText value="#{bundle['locanet.pessoa.nome']}" />
					</f:facet>
					<h:outputText value="#{c.nome}" />
				</p:column>

				<p:column>
					<f:facet name="header">
						<h:outputText value="#{bundle['locanet.cliente.cpf']}" />
					</f:facet>
					<h:outputText value="#{c.cpf}" />
				</p:column>

				<p:column>
					<f:facet name="header">
						<h:outputText value="#{bundle['locanet.pessoa.login']}" />
					</f:facet>
					<h:outputText value="#{c.login}" />
				</p:column>

				<p:column>
					<f:facet name="header">
						<h:outputText value="#{bundle['locanet.status']}" />
					</f:facet>
					<h:outputText style="color: #{c.status==1?'green':'red'};"
						value="#{c.status==1?bundle['locanet.entidades.status.ativo']:bundle['locanet.entidades.status.inativo']}" />
				</p:column>
			</p:dataTable>
		</h:form></div>
	</ui:define>
</ui:composition>
</html>